using System.Xml;
using UnityEngine;

public static class XmlHelper
{
    public static XmlNodeList GetXmlNodeList(string fileName, string nodeListPath)
    {
        XmlDocument XMLDoc = new XmlDocument();
        string xmlPath = Application.dataPath + "/StreamingAssets/" + fileName;//relative path of XML file
        XMLDoc.Load(xmlPath);
        XmlNodeList xnList = XMLDoc.SelectNodes(nodeListPath);
        return xnList;
    }

    public static string[] GetXmlStringList(string originString)
    {
        return GetXmlString(originString).Split("/");
    }
    public static string GetXmlString(string originString)
    {
        return originString.Replace("\n", string.Empty).Replace("\r", string.Empty).
            Replace("\t", string.Empty).Replace(" ", string.Empty);
    }
}